//角色列表ListView
Ext.define('byb.view.system.RoleListView',{
	extend:'Ext.view.View',
    tpl : new Ext.XTemplate(
    		'<tpl for=".">',
	    		'<div class="roleWrap">',
    				'<input type="hidden" value="{id}"/>{roleName}',
    			 '</div>',
    		'</tpl>'
    ),
    store:Ext.create('byb.store.system.AdmRole'),
    singleSelect : true,
    itemSelector : 'div.roleWrap',
    selectedItemCls : 'roleSelected',
    overItemCls	: 'roleOver',
    alias:'widget.roleListView',
    layout:'fit',
    loadMask: false,
    listeners: {
    	itemclick: function(ctx, record, item, index, e, eOpts ){
    		//item.setAttribute('class','roleWrap roleSelected');
    		ctx.disable();
    		var id = record.data.id;
    		name = record.data.roleName;
    		desc = record.data.discription;
    		byb.controller.SystemController.action = 'modifyRole';
    		Ext.ComponentQuery.query('sysmgr_roleManager form textfield[name=id]')[0].setValue(id);
    		Ext.ComponentQuery.query('sysmgr_roleManager form textfield[name=roleName]')[0].setValue(name);
    		Ext.ComponentQuery.query('sysmgr_roleManager form textfield[name=discription]')[0].setValue(desc);
    		byb.controller.SystemController.reloadAuthTreeStore(id);
   		}
		,afterrender:function(ctx){
			//var authTreeView = Ext.ComponentQuery.query('menuTreeView')[0];
    		//authTreeView.expandAll();
		}
    }
});
